<template>
	<view class="my-info">
		<view class="avatar">

			专业技能

		</view>
		<view class="content">
			<view class="myitem" v-for="item,index in addList" :key="index">
				<van-cell-group>
					<u-cell-item :border-bottom="border" :title-style="style" title="标题" :arrow="false">
						<u-input input-align="right" placeholder="标题" slot="right-icon" v-model="item.title"
							:clearable="border" :custom-style="inputStyle"></u-input>
					</u-cell-item>

					<u-cell-item :border-bottom="border" :title-style="style" title="技能" :arrow="false"
						v-for="skill,skillIndex in item.skill" :key="skillIndex">
						<u-input input-align="right" slot="right-icon" v-model="addList[index].skill[skillIndex]"
							:clearable="border" :custom-style="inputStyle"></u-input>
					</u-cell-item>
				</van-cell-group>
			</view>
			<button type="default" class="mybutton" @click="add()">添加</button>
			<button type="default" class="mybutton" @click="addItem()">添加技能</button>
			<button type="default" class="mybutton" @click="next()">下一步</button>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				addList: [{
					title: "",
					skill: [
						""
					]
				}],
				titleNum: 0,
				style: {
					'font-size': '26rpx',
					'font-weight': 'bold'
				},

			}
		},
		methods: {
			onLoad() {

			},
			add() {
				this.addList.push({
					title: "",
					skill: [

					]
				})
				this.titleNum++
				console.log(this.titleNum);
				console.log("添加一条记录");
			},
			addItem() {
				this.addList[this.titleNum].skill.push("")
				console.log("添加一条记录");
			},
			next() {
				uni.setStorage({
					key:'skill-info',
					data:this.addList,
					success() {
						console.log("存储成功")
						uni.navigateTo({
							url: "../introduce-info/introduce-info"
						})
					}
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	.my-info {
		background: rgba(224, 226, 252, 0.6);
		min-height: 100vh;
		height: auto;
		padding-bottom: 30rpx;
	}

	.inputStyle {
		width: 100%;
		background-color: red;
	}

	.avatar {
		height: 100rpx;
		padding: 20px 0;
		font-size: 30rpx;
		color: #928cd6;
		font-weight: 600;
		width: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.content {
		margin: 0 30rpx;
	}

	.avatar>image {
		width: 200rpx;
		height: 200rpx;
		border-radius: 100rpx;
	}

	.myitem {
		background-color: #ffffff;
		width: 100%;
		padding: 18rpx 0;
		border-radius: 20rpx;
		box-sizing: border-box;
		box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.1);
		margin-bottom: 40rpx;
		background-size: 100% 100%;
	}

	.mybutton {
		background-color: #ffffff;
		width: 100%;
		height: 90rpx;
		font-size: 27rpx;
		color: #928cd6;
		border-radius: 20rpx;
		box-sizing: border-box;
		box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.1);
		margin-bottom: 20rpx;
		line-height: 96rpx;
	}

	.myinput {
		background-color: #ffffff;
		width: 80%;
		height: 120rpx;
		font-size: 30rpx;
		font-weight: bold;
		color: #928cd6;
		border-radius: 40rpx;
		box-sizing: border-box;
		margin: 50rpx auto;
		box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.1);
		margin-bottom: 20rpx;
		line-height: 96rpx;
	}

	.mybuttonb {
		background-color: #ffffff;
		width: 100%;
		height: 90rpx;
		font-size: 27rpx;
		color: #c65c69;
		border-radius: 20rpx;
		box-sizing: border-box;
		box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.1);
		margin-bottom: 20rpx;
		line-height: 96rpx;
	}
</style>
